import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'

export function getToken() {
  var value = Cookies.get(TokenKey);
  if (value) {
    return JSON.parse(value)
  } else {
    return value
  }

}

export function setToken(token) {
  return Cookies.set(TokenKey, JSON.stringify(token))
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}